wpt_tmp->creation_time = 0;
if (pWptHxTmp->date.year)
{
- ptm = gmtime(&pWptHxTmp->time);
+ ptm = gmtime((time_t*)&pWptHxTmp->time);
tm.tm_hour = ptm->tm_hour;
tm.tm_min = ptm->tm_min;
tm.tm_sec = ptm->tm_sec;
sIndex = ((WPTHDR *)HxWFile)->num;
((WPTHDR *)HxWFile)->idx[sIndex] = sIndex; /* set the waypoint index */
+ ((WPTHDR *)HxWFile)->used[sIndex] = 0xff; /* Waypoint used */
+
/* set Waypoint */
pWptHxTmp = (WPT *)&HxWFile[OFFS_WPT + (sizeof(WPT) * sIndex)];
/*set the time */
if (wpt->creation_time)
{
- /* tm = gmtime(&wpt->creation_time); /* I get the wrong result with gmtime ??? */
+ /* tm = gmtime(&wpt->creation_time);*/ /* I get the wrong result with gmtime ??? */
tm = localtime(&wpt->creation_time);
pWptHxTmp->time = (tm->tm_hour * 3600) + (tm->tm_min * 60) +tm->tm_sec;
pWptHxTmp->date.day = tm->tm_mday;
pWptHxTmp->pt.iLatitude = (int)lat;
pWptHxTmp->pt.iLongitude = (int)lon;
pWptHxTmp->checked = 01;
-
+ pWptHxTmp->vocidx = (short)0xffff;
((WPTHDR *)HxWFile)->num = ++sIndex;
- ((WPTHDR *)HxWFile)->next= sIndex;
+ ((WPTHDR *)HxWFile)->next= ++sIndex;
}
/* clear index list */
for (sCount = 0; sCount < MAXWPT; sCount++)
- ((WPTHDR *)HxWFile)->idx[sCount] = (short)0xffff;
+ ((WPTHDR *)HxWFile)->idx[sCount] = (signed short)-1;
for (sCount = 0; sCount < MAXWPT; sCount++)
((WPTHDR *)HxWFile)->used[sCount] = 0;
/* init the route area */
((RTEHDR *)&HxWFile[ROUTESTART])->id = RTE_HDR_ID;
((RTEHDR *)&HxWFile[ROUTESTART])->num = 0;
- ((RTEHDR *)&HxWFile[ROUTESTART])->next = 0;
- ((RTEHDR *)&HxWFile[ROUTESTART])->rteno = 0;
+ ((RTEHDR *)&HxWFile[ROUTESTART])->next = 1;
+ ((RTEHDR *)&HxWFile[ROUTESTART])->rteno = (signed short)-1;
/* clear index list */
- for (sCount = 0; sCount < MAXWPT; sCount++)
- ((RTEHDR *)&HxWFile[ROUTESTART])->idx[sCount] = (short)0xffff;
- for (sCount = 0; sCount < MAXWPT; sCount++)
+ for (sCount = 0; sCount < MAXRTE; sCount++)
+ ((RTEHDR *)&HxWFile[ROUTESTART])->idx[sCount] = (signed short)-1;
+ for (sCount = 0; sCount < MAXRTE; sCount++)
((RTEHDR *)&HxWFile[ROUTESTART])->used[sCount] = 0;
#endif
-#define GM100_WPO_FILE_SIZE 25512 /* size of a holux gm-100 wpo file */
+/* #define GM100_WPO_FILE_SIZE 25512 */ /* size of a holux gm-100 wpo file used by mapShow 1.4*/
+#define GM100_WPO_FILE_SIZE 25600 /* size of a holux gm-100 wpo file used by the GM-100*/
#define ROUTESTART 23600 /* Offset for start of route */
#define MAXWPT 500 /* max number of waypoint */
POINT pt; /* waypoint location */
short vocidx; /* voice index, not used */
short usecount; /* counter: times used by routes */
- HX_DATE date; /* date */
+ HX_DATE date; /* date */
unsigned time; /* time */
char checked; /* Active or not */
BYTE dummy[3]; /* fill bytes */
typedef struct tagRTEHDR
{
- DWORD id; /* RTE_HDR_ID */
- short num; /* Current route number */
- short next; /* next route number */
- short idx[MAXRTE]; /* saving route index here for each route, default was -1 */
- BYTE used[MAXRTE]; /* Have the wpt been used (0xFF), Default was 0 */
- short rteno; /* Saving navigationroute number here */
+ DWORD id; /* RTE_HDR_ID */
+ short num; /* Current route number */
+ short next; /* next route number */
+ signed short idx[MAXRTE]; /* saving route index here for each route, default was -1 */
+ BYTE used[MAXRTE]; /* Have the wpt been used (0xFF), Default was 0 */
+ signed short rteno; /* Saving navigationroute number here */
}RTEHDR;